package com.hskn.hss.module.totalcost.ienum;

public enum EmpExpenseType {

    ALL("全部",0),
    PERSONNELMISCELLANEOUSEXPENSES("人员杂费", 1),
    WAGECOMPOSITION("工资组成", 2);
    // 成员变量
    private String name;
    private int index;
    // 构造方法
    private EmpExpenseType(String name, int index) {
        this.name = name;  
        this.index = index;  
    }  
    // 普通方法  
    public String getNameByIndex(int index) {
        for (EmpExpenseType c : EmpExpenseType.values()) {
            if (c.getIndex() == index) {  
                return c.name;  
            }  
        }  
        return null;  
    }  
    // 普通方法
    public Integer getIndexByName(String name) {
        for (EmpExpenseType c : EmpExpenseType.values()) {
            if (c.getName() .equals(name)) {
                return c.index;
            }
        }
        return null;
    }
    // get set 方法
    public String getName() {  
        return name;  
    }  
    public void setName(String name) {  
        this.name = name;  
    }  
    public int getIndex() {  
        return index;  
    }  
    public void setIndex(int index) {  
        this.index = index;  
    }  
}  